//
//  LoginView.m
//  GuiJuWo
//
//  Created by chenguibang on 16/3/26.
//  Copyright © 2016年 chenguibang. All rights reserved.
//

#import "LoginView.h"
#import "UIView+GBExtent.h"


@implementation LoginView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)init
{
    self = [super init];
    if (self) {
        UIView *bgView = [[UIView alloc]init];;
        [self addSubview:bgView];
        self.nameTf = [[TitleTextFiled alloc]init];
        [self addSubview:self.nameTf];
        self.passwdTf   = [[TitleTextFiled alloc]init];
        [self addSubview:self.passwdTf];
        
//        self.nameTf.layer.borderColor = UIColorWithString(0xeeeeee).CGColor;
//        self.nameTf.layer.borderWidth = 1;
        self.nameTf.placeholder = @"请输入账号";
//        self.passwdTf.layer.borderColor = UIColorWithString(0xeeeeee).CGColor;
//        self.passwdTf.layer.borderWidth = 1;
        self.passwdTf.placeholder = @"请输入密码";
        self.nameTf.sd_layout.leftEqualToView(self).topEqualToView(self).rightEqualToView(self).heightIs(33);
        self.passwdTf.sd_layout.leftEqualToView(self).topSpaceToView(self.nameTf,0).rightEqualToView(self).heightIs(33);
        
//        [self.nameTf addCornerWithType:CornerTypeAll color:[UIColor redColor] radius:20];
//        [self.passwdTf addCornerWithType:CornerTypeAll color:[UIColor redColor] radius:20];

        
        
        bgView.sd_layout.leftEqualToView(self.nameTf).topEqualToView(self.nameTf).rightEqualToView(self.nameTf).bottomEqualToView(self.passwdTf);
        bgView.backgroundColor = [UIColor whiteColor];
        
        
        
        
        self.loginBtn = [[UIButton alloc]init];;
        [self addSubview:self.loginBtn];
        self.loginBtn.sd_layout.topSpaceToView(self.passwdTf,10)
        .leftEqualToView(self.nameTf)
        .heightIs(30)
        .widthRatioToView(self.nameTf,0.49);
        [self.loginBtn setTitle:@"登录" forState:UIControlStateNormal];
        self.loginBtn.backgroundColor = [UIColor orangeColor];
        self.loginBtn.sd_cornerRadius = @(4);
        
        self.signBtn = [[UIButton alloc]init];;
        [self addSubview:self.signBtn];
        self.signBtn.sd_layout.topSpaceToView(self.passwdTf,10)
        .rightEqualToView(self.nameTf)
        .heightIs(30)
        .widthRatioToView(self.nameTf,0.49);
        [self.signBtn setTitle:@"免费注册" forState:UIControlStateNormal];
        self.signBtn.backgroundColor = [UIColor orangeColor];
        [self setupAutoHeightWithBottomView:self.loginBtn bottomMargin:0];
        self.signBtn.sd_cornerRadius = @(4);
       
        
        
    }
    return self;
}




//-(void)layoutSubviews{
//    NSLog(@"%f   %f ",self.frame.size.width,self.frame.size.height);
//}
@end
